package com.myblog.controller;


import com.myblog.service.impl.ArticleServiceImpl;
import com.myblog.utils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lhj
 * @since 2022-06-10
 */
@Controller
@RequestMapping("/article")
public class ArticleController {

    @Autowired
    private ArticleServiceImpl articleService;

    /**
     *
     * @param pageSize 每页数量
     * @param pageNum 当前页
     * @return
     */
    @RequestMapping(value = "/getArticle")
    @ResponseBody
    public PageResult getArticle(@RequestParam(value = "pageSize") Integer pageSize,
                                 @RequestParam(value = "pageNum") Integer pageNum){
        PageResult page = articleService.findPage(pageSize, pageNum);
        return page;
    }

}
